<?php
include('../config.php');
include(PUNG_ROOT . '/admin/header.php');

$adminmenu = array(
LANG_007 => 'console.php'
);

include(PUNG_ROOT . '/admin/head.php');

if(PHPCONSOLE == 'on')
{

if(isset($_POST['submit']))
{
	$code = stripslashes($_POST['phpcode']);
	ob_start();
	eval($code);
	$contents = ob_get_contents();
	ob_end_clean();
}
?>

<h3><?php print LANG_007; ?></h3>

<?php
if(isset($contents))
{
	print '<div style="padding: 10px; background-color: #FFFFCC; margin-bottom: 10px;">' . $contents . '</div>';
	unset($contents);
}
?>

<form action="" method="post">
<table width="100%">
<tr>
	<td><?php print LANG_037; ?></td>
</tr>
<tr>
	<td>
	<span style="color:red; font-weight:bold">&lt;?php</span>
	<textarea name="phpcode" id="console"></textarea>
	<span style="color:red; font-weight:bold">?&gt;</span>
	</td>
</tr>
<tr>
	<td><input type="submit" value="<?php print LANG_036; ?>" name="submit" class="form_button" /></td>
</tr>
</table>
</form>

<?php
}
else
{
	print '<h3>' . LANG_044 . '</h3>';
}

include(PUNG_ROOT . '/admin/footer.php');
?>